define(["jquery","template","bld/template/patient/treatPlanCourseEdit.tpl"],function($,template,tpl){
    var ui = {};

    var drawInfo = function(data) {
        return template("tpl_treatPlanCourseEdit_info", data);
    }
    var drawTitle = function(data) {
        return template("tpl_treatPlanCourseEdit_title", data);
    }
    var drawTable = function(data) {
        return template("tpl_treatPlanCourseEdit_table", data);
    }
    var drawAdd = function(data) {
        return template("tpl_treatPlanCourseEdit_add", data);
    }
    var drawSmallClass = function(data) {
        return template("tpl_treatPlanCourseEdit_smallClass", data);
    }
    var drawSelectCallBack = function(data) {
        return template("tpl_treatPlanCourseEdit_select", data);
    }

    ui.info = function(options) {
        $("#" + options.id).html(tpl.info());
        var h = drawInfo(options.info);
        $("#" + options.id).html(h);
    }
    ui.title = function(options){
		$("#" + options.id).html(tpl.title());
        var h = drawTitle(options);
        $("#" + options.id).html(h);
	}
	ui.table = function(options) {
        $("#" + options.id).html(tpl.table());
        var h = drawTable(options);
        $("#" + options.id).html(h);
    }
    ui.add = function(options) {
        options.dom.html(tpl.add());
        var h = drawAdd(options);
        options.dom.html(h);
    }
    ui.smallClass = function(options) {
        options.dom.html(tpl.smallClass());
        var h = drawSmallClass(options);
        options.dom.html(h);
    }
    ui.selectCallBack = function(options) {
        $("#" + options.id).html(tpl.selectCallBack());
        var h = drawSelectCallBack(options);
        $("#" + options.id).html(h);
    }

    return ui;
});